home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / spiele / publicdomain / elan / src / interf.h < prev    next >
C/C++ Source or Header  |  1996-06-07  |  3KB  |  148 lines

  1.  
  2. #include <ctype.h>
  3.  
  4. typedef enum command_opcode
  5.     {
  6.     cmd_nop,
  7.     cmd_day,
  8.     cmd_forward,
  9.     cmd_year,
  10.     cmd_add_dev,
  11.     cmd_del_dev,
  12.     cmd_add_chl,
  13.     cmd_ext_chl,
  14.     cmd_swap_chl,
  15.     cmd_del_chl,
  16.     cmd_add_mob,
  17.     cmd_buy_dev,
  18.     cmd_buy_mob,
  19.     cmd_trade_dev,
  20.     cmd_switch_dev,
  21.     cmd_set_dev,
  22.     cmd_set_mob,
  23.     cmd_reset,
  24.     cmd_start,
  25.     cmd_load,
  26.     cmd_save,
  27.     cmd_dump,
  28.     cmd_quit,
  29.     cmd_esc,
  30.     COMMAND_OPCODE_NUMBER
  31.     } command_opcode;
  32.  
  33. typedef struct user_command
  34.     {
  35.     command_opcode opcode;
  36.     cell *loc_arg;
  37.     direction dir_arg;
  38.     real num_arg;
  39.     } user_command;
  40.  
  41. typedef enum input_mode
  42.     {
  43.     start_mode,
  44.     control_mode,
  45.     install_channel_mode,
  46.     extend_channel_mode,
  47.     trade_mode,
  48.     watch_mode,
  49.     run_mode,
  50.     pause_mode,
  51.     INPUT_MODE_NUMBER
  52.     } input_mode;
  53.  
  54. #define HISTORY_LEN 10
  55. typedef struct message_history
  56.     {
  57.     int last;
  58.     message_class message[HISTORY_LEN];
  59.     int time[HISTORY_LEN];
  60.     boolean clear_message;
  61.     } message_history;
  62.  
  63. typedef struct interface
  64.     {
  65.     input_mode mode;
  66.     message_history history;
  67.     cell *cursor;
  68.     } interface;
  69.  
  70. typedef enum style_type
  71.     {
  72.     standard_style,
  73.     highlight_style,
  74.     halflight_style,
  75.     control_style,
  76.     install_style,
  77.     extend_style,
  78.     trade_style,
  79.     failure_style,
  80.     STYLE_TYPE_NUMBER
  81.     } style_type;
  82.  
  83. #define MAP_ROW             0
  84. #define LEGEND_ROW          2
  85. #define ENV_ROW             (MAP_ROW + LEGEND_ROW + PRIMARY_RT_NUMBER + 1)
  86. #define ENV_COL             (MAP_COLS + 3)
  87. #define USR_ROW             (ENV_ROW + 9)
  88. #define USR_COL             ENV_COL
  89. #define MODE_ROW            (USR_ROW + 8)
  90. #define MODE_COL            USR_COL
  91. #define MESSAGE_ROW         (MAP_ROWS + 1)
  92. #define MESSAGE_COL         0
  93. #define ZOOM_ROW            (MESSAGE_ROW + 2)
  94. #define LIST_ROW            ZOOM_ROW
  95. #define HISTORY_ROW         ZOOM_ROW
  96. #define LIST_FIRST_COL      0
  97. #define LIST_SECOND_COL     34
  98. #define HELP_ROW            ZOOM_ROW
  99. #define STATS_ROW           ZOOM_ROW
  100.  
  101. /* 80-chars bar */
  102. #define BAR "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  103.  
  104. #define ESC_KEY             '\x1b'
  105. #define BACKSPACE_KEY       '\x08'
  106.  
  107. #define KNOB_RESOLUTION     0.05
  108.  
  109. /* Dummy functions */
  110. #define unlock_interface()
  111.  
  112. extern interface ifc;
  113.  
  114. /* Protos */
  115. void open_io(void);
  116. void close_io(void);
  117. void init_interface(void);
  118. user_command query_for_command(event news);
  119. int query_for_item(const char **name, const icon_type *icon, const real *price,
  120.     int *storage, int class_number);
  121. void pause(void);
  122. boolean receive_interrupt(void);
  123. void lock_interface(void);
  124. void display_symbol(symbol *sp);
  125. void display_map(void);
  126. void display_cell(cell *loc);
  127. void display_neighbors(cell *loc);
  128. void display_factors(void);
  129. void display_user(void);
  130. void display_zoom(cell *loc);
  131. void display_ground_infos(cell *loc);
  132. void display_device(device *plant);
  133. void display_channel(channel *duct);
  134. void display_mobile(mobile *turtle);
  135. void display_frame(void);
  136. void display_mode(input_mode mode);
  137. void display_message(message_class message);
  138. void display_history(void);
  139. void display_stats(void);
  140. void display_help(void);
  141. void set_style(style_type style);
  142. void redraw_screen(void);
  143.  
  144. /* Dummy protos
  145. void unlock_interface(void);
  146. */
  147.  
  148.